/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
var selectedTrip = -1;
function dropAll(drop){
    var greyDown = false;
    if($("#locationsNearMeDropUp").css("display") != "none" && drop != "nearMe"){
        $("#locationsNearMeDropUp").slideToggle("fast");
        greyDown = false;
    }
    if($("#addWaypointDropUp").css("display") != "none" && drop != "waypoint"){
        $("#addWaypointDropUp").slideToggle("fast");
        greyDown = true;
    }
    if($("#dayPlannerDropUp").css("display") != "none" && drop != "day"){
        $("#dayPlannerDropUp").slideToggle("fast");
        greyDown = true;
    }
    if($("#statsDropUp").css("display") != "none" && drop != "stats"){
        $("#statsDropUp").slideToggle("fast");
        greyDown = true;
    }
    if($("#friendsDropUp").css("display") != "none" && drop != "friend"){
        $("#friendsDropUp").slideToggle("fast");
        greyDown = true;
    }
    return greyDown;
}
$("#TripCreationButton").click(function(){
    location.href="./createTrip.jsp";
})
$("#SignOutButton").click(function(){ //REDIRECT TO A BEAN KILLING SERVLET OR SOMETHING
    location.href="./login.jsp";
});
$("#AccountButton").click(function(){ 
    location.href="./accountpage.jsp";
});
$("#AddFriendToTripButton").click(function(){
    var gD = dropAll("friend");
    $("#friendsDropUp").slideToggle("fast");
    if(gD == false){
        $("#greyout").slideToggle("fast");
    }
});
$("#StatsButton").click(function(){
    var gD = dropAll("stats");
    $("#statsDropUp").slideToggle("fast");
    if(gD == false){
        $("#greyout").slideToggle("fast");
    }
});
$("#DayPlannerButton").click(function(){
    var gD = dropAll("day");
    $("#dayPlannerDropUp").slideToggle("fast");
    if(gD == false){
        $("#greyout").slideToggle("fast");
    }
});
$("#AddAWaypointButton").click(function(){
    var gD = dropAll("waypoint");
    $("#addWaypointDropUp").slideToggle("fast");
    if(gD == false){
        $("#greyout").slideToggle("fast");
    }
});
$("#LocationsNearMeButton").click(function(){
    var gD = dropAll("nearMe");
    $("#locationsNearMeDropUp").slideToggle("fast");
    if(gD == false){
//        $("#greyout").slideToggle("fast");
    }
});